/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { Request, Response } from 'express';
import { responseSuccess } from '../utils';
import Mock from 'mockjs';

export default {
  'POST /CustomerServiceV2/getSmsReviewList': (req: Request, res: Response) => {
    if (req.body.status === 'approved') {
      return res.send(
        Mock.mock({
          code: 0,
          msg: '成功',
          data: {
            total_count: 3,
            page_count: 1,
            list: [
              {
                id: '35',
                cm_id: '428220',
                cm_phone: '13671856416',
                brand: 'sto',
                user_type: 'normal',
                user_info:
                  '{"regDayDiff":47,"YZMC":"","YZDZ":"","YZDH":"","YZYYSJ":"-","KDY_PHONE":"13671856416","CM_PHONE":"13671856416"}',
                data_info:
                  '{"total":"0","starPercent":0,"successPercent":0,"pass":"0","reject":"0","daojian":1,"paijian":1,"toudi":"6","ruku":0,"chuku":0,"todaySent":4,"thisCount":1}',
                send_info:
                  '{"template":"\\u4f60\\u597d\\uff01\\u4f60\\u7684\\u5feb\\u9012\\u5df2\\u7ecf\\u653e\\u5728\\u4f20\\u8fbe\\u5ba4\\uff0c\\u8bf7\\u62bd\\u7a7a\\u53bb\\u53d6\\u4ef6\\uff0c\\u8c22\\u8c22\\uff01","DH":"","BH":"3","LOCATION":""}',
                channel: 'sms',
                ident: '3e762b50dad3d6e95222fe51f6408e79',
                create_time: '2023-06-20 14:09:02',
                approval_time: '2023-06-20 15:38:15',
                approver: 'test',
                status: 'reject',
              },
            ],
          },
        }),
      );
    }
    return res.send({
      code: 0,
      msg: '成功',
      data: {
        total_count: 26,
        page_count: 3,
        list: [
          {
            id: '31',
            cm_id: '1957041',
            cm_phone: '18829900094',
            brand: 'dak',
            user_type: 'trusted',
            user_info:
              '{"regDayDiff":1309,"YZMC":"旺角驿站测试环境1","YZDZ":"人民广场吃炸鸡","YZDH":"18829900094","YZYYSJ":"00:00-16:00","KDY_PHONE":"18829900094","CM_PHONE":"18829900094"}',
            data_info:
              '{"total":"3","starPercent":0,"successPercent":100,"pass":"0","reject":"0","daojian":0,"paijian":0,"toudi":0,"ruku":0,"chuku":0,"todaySent":15,"thisCount":3}',
            send_info:
              '{"template":"\\u4f60\\u597d\\uff0c\\u4f60\\u7684\\u5feb\\u4ef6\\u5df2\\u51c6\\u5907\\u6d3e#NO#\\u9001\\uff0c\\u5355\\u53f7#DH#\\u8bf7\\u51c6\\u5907\\u6536\\u4ef6","DH":"020,021,023,024,025","BH":"139,140","LOCATION":""}',
            channel: 'sms',
            ident: 'a5fa73f2c122ab77b1709caa3e47bc7d',
            create_time: '2023-06-20 11:40:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '15',
            cm_id: '1428238',
            cm_phone: '17596123053',
            brand: 'postx',
            user_type: 'normal',
            user_info:
              '{"regDayDiff":1772,"YZMC":"","YZDZ":"","YZDH":"","YZYYSJ":"-","KDY_PHONE":"17596123053","CM_PHONE":"17596123053"}',
            data_info: '',
            send_info:
              '{"template":"\\u53d1#DH#\\u5f80\\u5e7f\\u5dde\\u5e02\\u7684\\u90ae\\u653f\\u5feb\\u53059767127166578\\u5df2\\u53d1\\u51fa\\uff0c\\u8be6\\u60c5\\uff1ahttp:\\/\\/kd1.cn\\/SKqr9ot","DH":"","BH":"","LOCATION":""}',
            channel: 'wechat',
            ident: '9ca0c732be9819b8a6beff4f5c05f088',
            create_time: '2023-06-16 17:06:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '16',
            cm_id: '1428238',
            cm_phone: '17596123053',
            brand: 'postx',
            user_type: 'normal',
            user_info:
              '{"regDayDiff":1772,"YZMC":"","YZDZ":"","YZDH":"","YZYYSJ":"-","KDY_PHONE":"17596123053","CM_PHONE":"17596123053"}',
            data_info: '',
            send_info:
              '{"template":"\\u4ece\\u4e0a\\u6d77\\u5e02\\u5bc4\\u7ed9\\u60a8\\u7684\\u90ae\\u653f\\u5feb\\u53059767127166578\\u5df2\\u53d1\\u51fa\\uff0c\\u7269\\u6d41\\u66f4\\u65b0\\u8bf7\\u67e5\\u770b\\uff1ahttp:\\/\\/kd1.cn\\/xai5BKw","DH":"","BH":"","LOCATION":""}',
            channel: 'wechat',
            ident: '1f6577dbc1af357ac4ad6019e9e56faf',
            create_time: '2023-06-16 17:06:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '8',
            cm_id: '1748861',
            cm_phone: '13671856416',
            brand: 'dak',
            user_type: 'untrusted',
            user_info:
              '{"regDayDiff":689,"YZMC":"断小弦儿","YZDZ":"沙溪古镇停车场入口","YZDH":"0513-87942015","YZYYSJ":"08:00","KDY_PHONE":"13671856416","CM_PHONE":"13671856416"}',
            data_info: '',
            send_info:
              '{"template":"\\u4eb2\\uff0c#DH#\\u5df2\\u5230#YZDZ#\\uff0c\\u63d0\\u8d27\\u7801#NO#\\uff0c\\u8bf7\\u901f\\u6765\\u53d6\\uff0c\\u6709\\u95ee\\u9898\\u8054\\u7cfb#YZDH#","DH":["25484544646664","3434664848454554","963434554555154","245481845466464"],"BH":["4","3","2","1"],"LOCATION":"\\u6c99\\u6eaa\\u53e4\\u9547\\u505c\\u8f66\\u573a\\u5165\\u53e3"}',
            channel: 'sms',
            ident: 'be1514345b1e365a377fa8a81c1065ba',
            create_time: '2023-06-16 14:41:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '10',
            cm_id: '1748861',
            cm_phone: '13671856416',
            brand: 'dak',
            user_type: 'untrusted',
            user_info:
              '{"regDayDiff":689,"YZMC":"断小弦儿","YZDZ":"通协路建滔商业广场","YZDH":"0513-87942015","YZYYSJ":"08:00","KDY_PHONE":"13671856416","CM_PHONE":"13671856416"}',
            data_info: '',
            send_info:
              '{"template":"\\u60a8\\u597d\\uff0c\\u60a8\\u7684\\u5feb\\u9012\\u5df2\\u5230#YZDZ#\\uff0c\\u8bf7\\u51ed\\u53d6\\u8d27\\u7801#NO#\\u6765\\u53d6\\uff0c\\u6709\\u95ee\\u9898\\u8bf7\\u8054\\u7cfb#YZDH#","DH":"777111111112223","BH":"2","LOCATION":""}',
            channel: 'sms',
            ident: 'c003f065007608c1eea72c5192969732',
            create_time: '2023-06-16 15:04:02',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '30',
            cm_id: '1957041',
            cm_phone: '18829900094',
            brand: 'dak',
            user_type: 'untrusted',
            user_info:
              '{"regDayDiff":1309,"YZMC":"旺角驿站测试环境1","YZDZ":"人民广场吃炸鸡","YZDH":"18829900094","YZYYSJ":"00:00-16:00","KDY_PHONE":"18829900094","CM_PHONE":"18829900094"}',
            data_info:
              '{"total":"3","starPercent":0,"successPercent":100,"pass":"0","reject":"0","daojian":0,"paijian":0,"toudi":0,"ruku":0,"chuku":0,"todaySent":12,"thisCount":3}',
            send_info:
              '{"template":"\\u4f60\\u597d\\uff0c\\u4f60\\u7684\\u5feb\\u4ef6\\u5df2\\u51c6\\u5907\\u6d3e\\u9001\\uff0c\\u5355\\u53f7#DH#\\u8bf7\\u51c6\\u5907\\u6536\\u4ef6","DH":"020,021,023","BH":"136,137,138","LOCATION":""}',
            channel: 'sms',
            ident: 'b0c3090d3760cdaf93992158fb227e51',
            create_time: '2023-06-20 11:27:02',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '31',
            cm_id: '1957041',
            cm_phone: '18829900094',
            brand: 'dak',
            user_type: 'untrusted',
            user_info:
              '{"regDayDiff":1309,"YZMC":"旺角驿站测试环境1","YZDZ":"人民广场吃炸鸡","YZDH":"18829900094","YZYYSJ":"00:00-16:00","KDY_PHONE":"18829900094","CM_PHONE":"18829900094"}',
            data_info:
              '{"total":"3","starPercent":0,"successPercent":100,"pass":"0","reject":"0","daojian":0,"paijian":0,"toudi":0,"ruku":0,"chuku":0,"todaySent":15,"thisCount":3}',
            send_info:
              '{"template":"\\u4f60\\u597d\\uff0c\\u4f60\\u7684\\u5feb\\u4ef6\\u5df2\\u51c6\\u5907\\u6d3e\\u9001\\uff0c\\u5355\\u53f7#DH#\\u8bf7\\u51c6\\u5907\\u6536\\u4ef6","DH":"020,021,023","BH":"139,140,141","LOCATION":""}',
            channel: 'sms',
            ident: 'a5fa73f2c122ab77b1709caa3e47bc7d',
            create_time: '2023-06-20 11:40:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '32',
            cm_id: '1957041',
            cm_phone: '18829900094',
            brand: 'dak',
            user_type: 'untrusted',
            user_info:
              '{"regDayDiff":1309,"YZMC":"旺角驿站测试环境1","YZDZ":"人民广场吃炸鸡","YZDH":"18829900094","YZYYSJ":"00:00-16:00","KDY_PHONE":"18829900094","CM_PHONE":"18829900094"}',
            data_info:
              '{"total":"3","starPercent":0,"successPercent":100,"pass":"0","reject":"0","daojian":0,"paijian":0,"toudi":0,"ruku":0,"chuku":0,"todaySent":18,"thisCount":3}',
            send_info:
              '{"template":"\\u4f60\\u597d\\uff0c\\u4f60\\u7684\\u5feb\\u4ef6\\u5df2\\u51c6\\u5907\\u6d3e\\u9001\\uff0c\\u5355\\u53f7#DH#\\u8bf7\\u51c6\\u5907\\u6536\\u4ef6","DH":"020,021,023","BH":"142,143,144","LOCATION":""}',
            channel: 'sms',
            ident: 'b55752c7ca82a7f7c2028621ec53842f',
            create_time: '2023-06-20 13:36:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '20',
            cm_id: '1957205',
            cm_phone: '18715276649',
            brand: 'dak',
            user_type: 'untrusted',
            user_info:
              '{"regDayDiff":1264,"YZMC":"浙江周树人大学","YZDZ":"政府办公室","YZDH":"18715276649","YZYYSJ":"11:00","KDY_PHONE":"18715276649","CM_PHONE":"18715276649"}',
            data_info: '',
            send_info:
              '{"template":"\\u60a8\\u597d\\uff0c\\u60a8\\u7684\\u5feb\\u9012\\u5df2\\u5230#YZDZ#\\uff0c\\u8bf7\\u51ed\\u53d6\\u8d27\\u7801#NO#\\u6765\\u53d6\\uff0c\\u6709\\u95ee\\u9898\\u8bf7\\u8054\\u7cfb#YZDH#","DH":"866567646621","BH":"1","LOCATION":""}',
            channel: 'wechat',
            ident: 'eb18841e8c56644b91943eece5959c1a',
            create_time: '2023-06-19 11:20:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '23',
            cm_id: '1957205',
            cm_phone: '18715276649',
            brand: 'dak',
            user_type: 'untrusted',
            user_info:
              '{"regDayDiff":1265,"YZMC":"浙江周树人大学","YZDZ":"政府办公室","YZDH":"18715276649","YZYYSJ":"11:00","KDY_PHONE":"18715276649","CM_PHONE":"18715276649"}',
            data_info: '',
            send_info:
              '{"template":"\\u60a8\\u597d\\uff0c\\u60a8\\u7684\\u5feb\\u9012\\u5df2\\u5230#YZDZ#\\uff0c\\u8bf7\\u51ed\\u53d6\\u8d27\\u7801#NO#\\u6765\\u53d6\\uff0c\\u6709\\u95ee\\u9898\\u8bf7\\u8054\\u7cfb#YZDH#","DH":"64686656699","BH":"2","LOCATION":""}',
            channel: 'wechat',
            ident: '68c48de5dab09c510c6fd8bdbe635e32',
            create_time: '2023-06-20 10:33:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
          {
            id: '24',
            cm_id: '1957205',
            cm_phone: '18715276649',
            brand: 'dak',
            user_type: 'untrusted',
            user_info:
              '{"regDayDiff":1265,"YZMC":"浙江周树人大学","YZDZ":"政府办公室","YZDH":"18715276649","YZYYSJ":"11:00","KDY_PHONE":"18715276649","CM_PHONE":"18715276649"}',
            data_info: '',
            send_info:
              '{"template":"\\u60a8\\u597d\\uff0c\\u60a8\\u7684\\u5feb\\u9012\\u5df2\\u5230#YZDZ#\\uff0c\\u8bf7\\u51ed\\u53d6\\u8d27\\u7801#NO#\\u6765\\u53d6\\uff0c\\u6709\\u95ee\\u9898\\u8bf7\\u8054\\u7cfb#YZDH#","DH":"566469466535","BH":"3","LOCATION":""}',
            channel: 'wechat',
            ident: '2bc816e334de8d041f4060d88ecbef10',
            create_time: '2023-06-20 10:33:01',
            approval_time: null,
            approver: '',
            status: 'wait',
          },
        ],
      },
    });
    const data = Mock.mock({
      'list|10': [
        {
          id: '@id',
          cm_id: '@id',
          cm_phone: '@phone',
          'brand|1': ['sto', 'dak'],
          'user_type|1': ['untrusted', 'normal', 'trusted'],
          user_info:
            '{"regDayDiff":47,"YZMC":"","YZDZ":"","YZDH":"","YZYYSJ":"-","KDY_PHONE":"13671856416","CM_PHONE":"13671856416"}',
          data_info:
            '{"total":"0","starPercent":0,"successPercent":0,"pass":"0","reject":"0","daojian":1,"paijian":1,"toudi":"6","ruku":0,"chuku":0,"todaySent":4,"thisCount":1}',
          send_info:
            '{"template":"你好！你的快递已经放在传达室，单号#DH#，编号#BH#位置#LOCATION#请抽空去取件，谢谢！","DH":"7574848438","BH":"3-747-48","LOCATION":"建滔广场"}',
          channel: 'sms',
          ident: '3e762b50dad3d6e95222fe51f6408e79',
          create_time: '2023-06-20 14:09:02',
          approval_time: '2023-06-20 15:38:15',
          approver: 'test',
          'status|1': ['wait', 'pass', 'reject'],
        },
      ],
    });
    const result = {
      code: 0,
      msg: 'success',
      data: {
        list: data.list,
        total_count: 36,
        page_count: 1,
      },
    };
    return res.json(result);
  },
  'POST /CustomerServiceV2/getTodaySentList': (req: Request, res: Response) => {
    return res.json(
      Mock.mock({
        code: 0,
        msg: '成功',
        data: {
          total_count: 36,
          page_count: 1,
          'list|20': [
            {
              id: '@id',
              notify_id: '489703977',
              mobile: '@phone',
              dh: '',
              content: '@ctitle',
              sms_sign: '中邮驿站',
              send_time: '@date',
              sms_supplier: 'cly_new',
            },
          ],
        },
      }),
    );
  },
  'POST /CustomerServiceV2/upgradeUserTypeForSendSms': (req: Request, res: Response) =>
    responseSuccess(req, res),
  'POST /CustomerServiceV2/approveSmsReview': (req: Request, res: Response) =>
    responseSuccess(req, res),
};
